<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
    <link href="__ADMIN__/css/plugins/toastr/toastr.min.css" rel="stylesheet">
</head>
<body>
<div style="margin-top: 300px">
    <button onclick="success()">成功</button>
    <button onclick="error()">失败</button>
    <button onclick="warning()">警告</button>
    <button onclick="info()">提示信息</button>
    <button onclick="layer_test()">询问框</button>
</div>
</body>
<script src="__STATIC__/jquery/jquery-3.1.1.min.js"></script>
<script src="__PLUG__/toastr/toastr.min.js"></script>
<script src="/static/layer/mobile/layer.js"></script>
<script>
    function success() {
        toastr.options = {
            timeOut: 1500,
            positionClass: 'toast-top-full-width'
        };
        toastr.success('成功')
    }

    function error() {
        toastr.error('失败')
    }

    function warning() {
        toastr.warning('警告')
    }

    function info() {
        toastr.info('提示信息')
    }

    function layer_test() {
        layer.open({
            content: '您确定要结束客服吗？'
            , btn: ['结束', '取消']
            , yes: function (index) {
                layer.close(index);

                // 业务逻辑
            }
        })
    }
</script>
</html>